<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=1qqpadv0OGHlyEtGy4ScIUllTRbcyPcC"></script>
  <!--  <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=WdqZdWqAkjMtayZFaswW4jgRNO094HDY"></script> -->
</head>

<body>
  <div style="width:697px;height:550px;border:#ccc solid 1px;" id="map"></div>
</body>
<script type="text/javascript"> //创建和初始化地图函数： function initMap() { createMap();//创建地图 setMapEvent();//设置地图事件 addMapControl();//向地图添加控件 addMapOverlay();//向地图添加覆盖物 } function createMap() { map=new BMap.Map("map");
  map.centerAndZoom(new BMap.Point(116.371679, 39.937022), 12); } function setMapEvent() { map.enableScrollWheelZoom(); map.enableKeyboard(); map.enableDragging(); map.enableDoubleClickZoom() } function
    addClickHandler(target, window) { target.addEventListener("click", function () { target.openInfoWindow(window); }); } function addMapOverlay() { } //向地图添加控件 function addMapControl() { var scaleControl=new
  BMap.ScaleControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT }); scaleControl.setUnit(BMAP_UNIT_IMPERIAL); map.addControl(scaleControl); var navControl = new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_LEFT, type: 0 });
  map.addControl(navControl); var overviewControl = new BMap.OverviewMapControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: true }); map.addControl(overviewControl); } var map; initMap(); </script>

</html>
